package Foundmentation;

public class Type {
    static int f;//字常量默认值为0
    static boolean e;
    public static void main(String[] args) {
        double a = 1.0;
        double b = 2.0;
        boolean c = true;
        int d = 20;
        int u = 20;
        long z = 30L;
        long q = u+z;//int型与long型相加int型会被提升成long型
        byte r = 30;//采用int型存储
        byte g = 40;
        byte h = (byte)(r+g);//r+g为int+int还是int，大类型到小类型需要强转
        String j= "计算结果:"+d+u;
        String m = String.valueOf(u);//将int型转换成字符串类型
        String str = "12345";
        int num = Integer.parseInt(str);//将字符串类型转换成int型
        System.out.println(f);
        System.out.println(e);
        System.out.println(a/b);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);
        System.out.println(c);
        System.out.println(d);
        System.out.println(h);
        System.out.println(j);
        System.out.println(m + 20);//字符串+任何类型采用字符串拼接
        System.out.println(num+1);
        System.out.println(q);

    }
}

